using System;
using InfoJetSoft.Service.Util;

namespace InfoJetSoft.Service.ManagedCode
{
	/// <summary>
	/// Summary description for XMLFileAdapter.
	/// </summary>
	public class XMLFileAdapter : Microsoft.Office.Interop.InfoPath.SemiTrust.XMLFileAdapterObject
	{
		private InfoJetSoft.Service.Entity.Form form = null;
		private InfoJetSoft.Service.Entity.DataFileAdapter fileAdapter = null;

		public XMLFileAdapter( InfoJetSoft.Service.Entity.Form frm, InfoJetSoft.Service.Entity.DataFileAdapter adapter )
		{
			this.form = frm;
			this.fileAdapter = (InfoJetSoft.Service.Entity.DataFileAdapter)DataAdapterTableUtil.getCurrentAdapter( this.form, adapter );
		}

		public string FileURL 
		{ 
			get
			{
				return this.fileAdapter.Name;
			}
			set
			{
			} 
		}

		public bool QueryAllowed 
		{ 
			get
			{
				return this.fileAdapter.QueryAllowed;
			}
		}

		public bool SubmitAllowed 
		{ 
			get
			{
				return this.fileAdapter.SubmitAllowed;
			}
		}

		public string Name 
		{ 
			get
			{
				return this.fileAdapter.Name;
			}
		}

		public void Query()
		{
			return;
		}

		//Unsupported
		public void Submit()
		{
		}

	}
}
